home *** CD-ROM | disk | FTP | other *** search
/ Total Web Page (Professional Suite) / Total Web Page 99.iso / CGI / DOWNLOAD.CGI-S=RAND_IMAGE&C=TXT&F=README < prev    next >
Text File  |  1996-06-03  |  8KB  |  138 lines

  1. ##############################################################################
  2. # Basic Random Image Displayer  Version 1.2                                  # 
  3. # Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
  4. # Created 7/1/95                Last Modified 7/20/95                        #
  5. # Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
  6. ##############################################################################
  7. # If you run into any problems while trying to configure this scripts, help  #
  8. # is available.  The steps you should take to get the fastest results, are:  #
  9. #       1) Read this file thoroughly                         #
  10. #       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
  11. #               http://www.worldwidemart.com/scripts/faq/                 #
  12. #       3) If you are still having difficulty installing this script, send   #
  13. #          e-mail to: scripts-help@tahoenet.com                     #
  14. #          Include any error messages you are receiving and as much detail   #
  15. #          as you can so we can spot your problem.  Also include the variable#
  16. #          configuration block that is located at the top of the script.     #
  17. #                                         #
  18. # Hopefully we will be able to help you solve your problems.  Thank you.     #
  19. ##############################################################################
  20. # COPYRIGHT NOTICE                                                           #
  21. # Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
  22. #                                                                            #
  23. # Basic Random Image may be used and modified free of charge by anyone so    #
  24. # long as this copyright notice and the comments above remain intact.  By    #
  25. # using this this code you agree to indemnify Matthew M. Wright from any     #
  26. # liability that might arise from it's use.                                  #  
  27. #                                                                            #
  28. # Selling the code for this program without prior written consent is         #
  29. # expressly forbidden.  In other words, please ask first before you try and  #
  30. # make money off of my program.                                              #
  31. #                                                                            #
  32. # Obtain permission before redistributing this software over the Internet or #
  33. # in any other medium.  In all cases copyright and header must remain intact.#
  34. ##############################################################################
  35.  
  36. The Random Image Displayer will allow you to call on different images each 
  37. time your page is reloaded and accessed.  The Random Image Displayer consists 
  38. of two files, the rand_image.pl and README.
  39.  
  40.                 rand_image.pl - The perl script that calls on the random image.
  41.                 README - This file (Installation instructions)
  42.  
  43. This is one of my more simple scripts, yet still very useful for its purpose.  
  44. Below is a description of how to configure the files:
  45.  
  46. RAND_IMAGE.PL -
  47.         This is the main file and the one that is called upon every time your 
  48. page is loaded.  You will need to place this file in your server's cgi-bin and 
  49. give users the permission to read/execute this file. (chmod 755 or chmod a+rx)  
  50. There are also several variables you will have to define:
  51.  
  52.         # Define Necessary Variables
  53.            $basedir = "";
  54.                 This is the http address and base directory that your pictures
  55.                 are placed in.  This is in url form.  The filenames you 
  56.                 specify will be appended to this address.  Examples Below.
  57.            @files = ("","");
  58.                 These are all of your files placed into array.  The filenames 
  59.                 should be reflective of the location of the files relative 
  60.                 to your $basedir. Examples Below.
  61.  
  62.         # Choose Options
  63.            $uselog = 1;    # 1 = YES; 0 = NO
  64.                 You can enable the usage of a short log, which will simply log 
  65.                 the name of each file as it is accessed.  Not very fancy, but 
  66.                 it can be useful.
  67.            $logfile = "";
  68.                 The system path to your log file and where you want it kept.  
  69.                 Keep in mind that this log file must be placed in a world 
  70.                 writable directory.  If you don't create a log file, but 
  71.                 point the path to a world writeable directory and give it a 
  72.                 false filename, the script will create the file for you.  This 
  73.                 is not a required variable if you turn off $uselog.
  74. ________________________________________________________________
  75.  
  76. README -
  77.         All you have to do with this file is read it!  :)
  78. ________________________________________________________________
  79.  
  80. Example:
  81. Let's say I have 5 files.  They are  all in a root directory called: 
  82. /home/mattw/public_html/, but from there they branch out to:
  83. pics/funny.gif, nature/waterfalls.gif, pics/cool.gif, nature/tree.gif, and 
  84. pics/www.gif.  Where pics/ and nature/ are directories that these images are 
  85. located in.  Your variables should show as follows:
  86.  
  87. $basedir = "http://alpha.pr1.k12.co.us/~mattw/";
  88. @files = ("pics/funny.gif","nature/waterfalls.gif","pics/cool.gif",
  89.           "nature/tree.gif","pics/www.gif");
  90.  
  91. It's that easy!
  92. ________________________________________________________________
  93.  
  94. How do I implement this in my pages?
  95.         This file can be used in your pages in one of the following syntaxes.  
  96. It can do backgrounds, or just plain image references.  To activate it do the 
  97. following:
  98. <img src="http://www.ser.ver/cgi-bin/rand_image.pl">
  99.         This is when you want it to call a random image.
  100. <body background="http://www.ser.ver/cgi-bin/rand_image.pl">
  101.         This is when you want it to call a random background.
  102.  
  103. Things to be careful of:
  104.         If you are using it as a random background program, you will want to 
  105. make sure that all of your backgrounds will work with the specified colors.  
  106. In other words, if you have a dark and a light image in your random image path 
  107. it will be hard to find a text color to work in both instances.
  108. ________________________________________________________________
  109. HISTORY:
  110. Version 1.0             7/1  - First Created
  111. Version 1.1             7/17 - Completely Re-written. Less variables to fill 
  112.                                in, added flexibility: including pics in 
  113.                                different directories and pics with names 
  114.                                unlike others.  A big improvement over the last
  115.                                version.  You can also have different 
  116.                                extensions like .jpg and .gif.
  117. Version 1.2             7/20 - Eliminated the $numfiles variable and can now 
  118.                                take the random number straight fom the array.
  119. ________________________________________________________________
  120.  
  121. Use this script freely and enjoy!  All that I ask is that you register your 
  122. script with me either by mailing me the url of where I can find it or filling 
  123. out the form located at:
  124. http://worldwidemart.com/scripts/implement.html
  125.  
  126. This registration is free but it allows me to add you to a list showing other 
  127. examples of my scripts, as well as it allows me to inform you of any upgrades 
  128. I ever release.  Thanks.
  129.  
  130. I also ask that you keep my name somewhere in the scripts.  Not necessarily in 
  131. a spot viewable to your users (although it would be nice) but somewhere behind 
  132. the scenes as a point of reference.
  133.  
  134. If you modify this script, please let me know just so I can improve it for 
  135. other users as well.  Enjoy!
  136. _____________________________________________________________________________
  137. Matt Wright - mattw@worldwidemart.com - http://www.worldwidemart.com/scripts/
  138.